{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "e8b14be3",
   "metadata": {},
   "outputs": [],
   "source": [
    "import seaborn as sns\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "57a769c6",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.read_csv(\"Spark/data/mllib/data/kmeans.txt\",names=['x','y'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "124e31a5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<seaborn.axisgrid.FacetGrid at 0x21d33819988>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWAAAAFgCAYAAACFYaNMAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAARkUlEQVR4nO3dX2yV933H8c/ngLGJjflrbCckMlTTKpkmpDpFVZNWW6RWtEEU7QJ1WhtVm8RNt6ZiWqRKEREo2m4m1ItdoaSqoqatoqVJUaqyRgtVFbX5Y1JCcejUqaFaAsaGNBgIBwznuwsbJ2Q2ZsTP+Z4/75dkYRv7PN+cizdPnvM7v8cRIQBA7ZWyBwCAVkWAASAJAQaAJAQYAJIQYABIsjB7gA/atGlT7N+/P3sMAJhvnumbdXUGfOrUqewRAKBm6irAANBKCDAAJCHAAJCEAANAEgIMAEkIMAAkIcAAkIQAA0ASAgwASerqrcgAUKTLl6saPn5Gb5+5oFVd7apGVT1di7V2VadKpRnfLVwoAgygJVy+XNWzr7+th589ospEVR1tJT2yeVD/+h//pb+992PaNNhX8whzCQJASxg+cWY6vpJUmahq13PDeuAz67TjqUM6dvp8zWciwABawokzlen4XlWZqOrCpcuqTFQ1erZS85kIMICW0L90sTrark1eR1tJixctVE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AAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.relplot(data=df, x=\"x\", y=\"y\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "faed908b",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.read_csv(\"Spark/data/mllib/kmeans/part-00000-3753ed14-a812-427e-a42b-9376e757d2c3-c000.csv\",names=['x','y','pre'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "becf11d2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>x</th>\n",
       "      <th>y</th>\n",
       "      <th>pre</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.00</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>5.01</td>\n",
       "      <td>5.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1.11</td>\n",
       "      <td>1.1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1.11</td>\n",
       "      <td>0.9</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1.11</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>5.12</td>\n",
       "      <td>5.2</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>1.53</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>1.24</td>\n",
       "      <td>1.6</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>5.31</td>\n",
       "      <td>5.1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>1.34</td>\n",
       "      <td>0.7</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>1.15</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>1.16</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>5.14</td>\n",
       "      <td>5.2</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>1.50</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>1.20</td>\n",
       "      <td>1.6</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>5.30</td>\n",
       "      <td>5.1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>1.30</td>\n",
       "      <td>0.7</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>1.10</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>1.10</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>5.10</td>\n",
       "      <td>5.2</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>1.50</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>1.20</td>\n",
       "      <td>1.6</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>5.30</td>\n",
       "      <td>5.1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>1.30</td>\n",
       "      <td>0.7</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>1.10</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>1.10</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>5.10</td>\n",
       "      <td>5.2</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>1.50</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>1.20</td>\n",
       "      <td>1.6</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>5.30</td>\n",
       "      <td>5.1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>1.30</td>\n",
       "      <td>0.7</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>1.10</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>5.30</td>\n",
       "      <td>5.1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>1.10</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>5.30</td>\n",
       "      <td>5.1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>1.10</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36</th>\n",
       "      <td>5.30</td>\n",
       "      <td>5.1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       x    y  pre\n",
       "0   1.00  1.0    0\n",
       "1   5.01  5.0    1\n",
       "2   1.11  1.1    0\n",
       "3   1.11  0.9    0\n",
       "4   1.11  1.3    0\n",
       "5   5.12  5.2    1\n",
       "6   1.53  1.0    0\n",
       "7   1.24  1.6    0\n",
       "8   5.31  5.1    1\n",
       "9   1.34  0.7    0\n",
       "10  1.15  1.3    0\n",
       "11  1.16  1.3    0\n",
       "12  5.14  5.2    1\n",
       "13  1.50  1.0    0\n",
       "14  1.20  1.6    0\n",
       "15  5.30  5.1    1\n",
       "16  1.30  0.7    0\n",
       "17  1.10  1.3    0\n",
       "18  1.10  1.3    0\n",
       "19  5.10  5.2    1\n",
       "20  1.50  1.0    0\n",
       "21  1.20  1.6    0\n",
       "22  5.30  5.1    1\n",
       "23  1.30  0.7    0\n",
       "24  1.10  1.3    0\n",
       "25  1.10  1.3    0\n",
       "26  5.10  5.2    1\n",
       "27  1.50  1.0    0\n",
       "28  1.20  1.6    0\n",
       "29  5.30  5.1    1\n",
       "30  1.30  0.7    0\n",
       "31  1.10  1.3    0\n",
       "32  5.30  5.1    1\n",
       "33  1.10  1.3    0\n",
       "34  5.30  5.1    1\n",
       "35  1.10  1.3    0\n",
       "36  5.30  5.1    1"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "7d900811",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<seaborn.axisgrid.FacetGrid at 0x21d33950b48>"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYwAAAFgCAYAAACov06zAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAWOElEQVR4nO3deZCcBZnH8d8z92Rmck/OyUU4AnIk0ATYWKCILCClLmgtCLK6rKkV3IJ1qyzPEnXXdbXKtbbUtcKhq1yyIpQFygpFJIJAmISAgRAgkJPATM6ZIclkjmf/6CYmmZB5Mpm33z6+n6qpmX6nu98n/Ue+8x79trm7AAAYTEXaAwAAigPBAACEEAwAQAjBAACEEAwAQEhV2gPs76KLLvKHHnoo7TEAICmW9gBHo6C2MLZs2ZL2CACAd1FQwQAAFC6CAQAIIRgAgBCCAQAIIRgAgBCCAQAIIRgAgBCCAQAIIRgAgJCCujQIAOTFxlap/WWptkFqnCh1bJLGHy+NP0Gqqkl7uoJFMACUl1cel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sKC1FHQwcyMxmSpon6emUR0lNblfMCkltkh5293J8LX4g6QuS+lOeoxC4pN+b2TIzW5j2MMWOYJQIM2uUdK+kG929I+150uLufe4+V1KLpPlmVla7Ks3sUklt7r4s7VkKxHvd/XRJF0u6PrcbG0NEMEpAbn/9vZLucPdfpz1PIXD3HZIWSyraC70N0QJJH87tu79b0vlmdnu6I6XH3TflvrdJuk/S/HQnKm4Eo8jlDvTeKmmVu38/7XnSZGbNZjY693O9pA9KeinVofLM3b/k7i3uPlPSFZIedferUx4rFWbWkDsRRGbWIOlCSWV7RuVwKOpgmNldkp6UdIKZbTSza9OeKQULJH1S2b8kV+S+Lkl7qJRMlrTYzJ6X9IyyxzDK+rTSMjdR0uNm9pykpZIedPeHUp6pqBX1abUAgPwp6i0MAED+EAwAQAjBAACEEAwAQAjBAACEEAwAQAjBAACEEAyUHTM708yez31+RkPuszPK6ppTwFDwxj2UJTP7V0l1kuolbXT3f095JKDgEQyUJTOrUfbyIXsk/ZW796U8ElDw2CWFcjVOUqOkJmW3NAAMgi0MlCUz+42yl/+epexH3H4u5ZGAgleV9gBAvpnZNZJ63P1OM6uU9CczO9/dH017NqCQsYUBAAjhGAYAIIRgAABCCAYAIIRgAABCCAYAIIRgAABCCAYAIOT/AbzjfBAMPkSTAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 402.375x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.relplot(data=df, x=\"x\", y=\"y\",hue=\"pre\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "86e04a43",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
